@import './common.less';

.badge(@width: 118/@ppr, @bgColor: rgb(255, 102, 85), @color: white, @fontSize: 24/@ppr) {
  width: @width;
  height: @width;
  position: absolute;
  top: -@width/2;
  left: -@width/2;
  background: @bgColor;
  color: @color;
  font-size: @fontSize;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  transform: rotateZ(-45deg);
  z-index: 2;
}

.coupon-wrapper {
  .coupon-cell {
    border: 1px solid rgb(232, 234, 238);
    border-bottom-width: 0;
  }
  border-radius: 10/@ppr;
  overflow: hidden;
  .circle-view {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin-top: -12/@ppr;
    margin-bottom: -12/@ppr;
    z-index: 8;
    .circle {
      border: 1px solid rgb(232, 234, 238);
      z-index: 9;
      width: 12/@ppr;
      height: 24/@ppr;
      background: @bg-color;
      &.left {
        border-left-width: 0;
        border-top-right-radius: 12/@ppr;
        border-bottom-right-radius: 12/@ppr;
      }

      &.right {
        border-right-width: 0;
        border-top-left-radius: 12/@ppr;
        border-bottom-left-radius: 12/@ppr;
      }
    }
  }
  .coupon-footer {
    border: 1px solid rgb(232, 234, 238);
    border-top-width: 0;
    background: transparent;
    position: relative;
    .text-row {
      background: #f8f8f8;
      padding: 16/@ppr 30/@ppr;
      display: flex;
      flex-direction: row;
      justify-content: flex-start;
      align-items: flex-start;
      .icon-question {
        font-size: 26/@ppr;
        color: rgb(140, 140, 148);
      }
      .text {
        color: #85ab86;
        font-size: 22/@ppr;
        margin: 0 0 0 12/@ppr;
        word-break: break-all;
        padding: 0;
      }
    }
  }
}

.coupon-list {
  .full-screen();
  background: @bg-color;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  .list-empty {
    .full-screen();
    margin: 0;
    .icon {
      margin-top: -50/@ppr;
    }
  }
  .header-base {
    background: white;
    height: 100/@ppr;
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    align-items: stretch;
    font-size: 30/@ppr;
    color: rgb(92, 92, 92);
    .tab-cell {
      position: relative;
      line-height: 100/@ppr;
      text-align: center;
      &.active {
        font-weight: bold;
        &:after {
          height: 3/@ppr;
          background: rgb(255, 102, 85);
          width: 64/@ppr;
          position: absolute;
          bottom: 0;
          left: 50%;
          margin-left: -32/@ppr;
          content: '';
        }
      }
    }
  }
  .header {
    height: 126/@ppr;
    background: #e9e8ee;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 0 30/@ppr;
    .title-view {
      display: flex;
      flex-direction: row;
      justify-content: flex-start;
      align-items: center;
      color: rgb(46, 46, 54);
      font-size: 36/@ppr;
      font-weight: bold;
    }
    .tab-view {
      overflow: hidden;
      height: 66/@ppr;
      border-radius: 33/@ppr;
      display: flex;
      flex-direction: row;
      justify-content: flex-start;
      align-items: stretch;
      .tab-cell {
        width: 176/@ppr;
        background: white;
        font-size: 28/@ppr;
        color: rgb(140, 143, 148);
        text-align: center;
        line-height: 66/@ppr;
        .hairline(right, rgb(233, 232, 238));
        &:last-child {
          .hairline-remove(right);
        }
        &.active {
          background: rgb(255, 102, 85);
          color: white;
          font-weight: bold;
        }
      }
    }
  }
  .list {
    position: relative;
    flex: 1;
    padding: 30/@ppr;
    .scrollable();
    .coupon-wrapper {
      margin-bottom: 20/@ppr;
      .coupon-cell {
        margin-bottom: 0;
      }
    }
  }
}

.coupon-cell {
  .status {
    position: absolute;
    background-image: url('../../images/coupon/status.png');
    background-repeat: no-repeat;
    background-position: top left;
    background-size: 100%;
    top: -12/@ppr;
    right: 18/@ppr;
    width: 108/@ppr;
    height: 108/@ppr;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    .text {
      font-size: 28/@ppr;
      color: rgb(181, 181, 181);
      transform: rotateZ(30deg);
    }
  }
  overflow: hidden;
  border-radius: 10/@ppr;
  .badge {
    .badge();
  }
  &.disabled {
    .badge {
      background: rgb(94, 94, 94);
    }
    .cell-header {
      color: rgb(94, 94, 94);
    }
  }
  background: white;
  height: 170/@ppr;
  margin-bottom: 36/@ppr;
  border-radius: 10/@ppr;
  border: 1px solid rgb(232, 234, 238);
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  align-items: center;
  position: relative;
  .cell-header {
    width: 182/@ppr;
    height: 90/@ppr;
    .hairline(right, rgb(232, 234, 238));
    overflow: visible;
    &:after {
      top: -20/@ppr;
    }
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: flex-start;
    color: rgb(255, 102, 85);
    position: relative;
    top: 20/@ppr;
    .unit {
      font-size: 30/@ppr;
      font-weight: bold;
      margin-left: 10/@ppr;
    }
    .money {
      position: relative;
      top: -10/@ppr;
      font-family: 'DINMittelschrift-Alternate';
      font-size: 70/@ppr;
    }
  }
  .cell-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding-left: 36/@ppr;
    .title {
      font-size: 30/@ppr;
      font-weight: bold;
      color: rgb(46, 46, 54);
    }
    .text {
      color: rgb(181, 181, 181);
      font-size: 26/@ppr;
      margin: 24/@ppr 0 0 0;
      padding: 0;
      line-height: 30/@ppr;
      &.multi {
        margin-top: 14/@ppr;
      }
    }
  }
  .cell-btn {
    width: 140/@ppr;
    height: 62/@ppr;
    border-radius: 31/@ppr;
    border: 1px solid rgb(255, 87, 75);
    text-align: center;
    line-height: 62/@ppr;
    color: rgb(255, 87, 75);
    font-size: 28/@ppr;
    margin-right: 26/@ppr;
  }
}

.coupon-select-modal {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: stretch;
  background: rgba(0, 0, 0, 0.3);
  z-index: 99;

  .content {
    background: white;
    height: 694/@ppr;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    .title-row {
      height: 90/@ppr;
      display: flex;
      flex-direction: row;
      justify-content: flex-start;
      align-items: center;
      padding: 0 30/@ppr;
      .icon-warn {
        font-size: 32/@ppr;
        color: rgb(206, 205, 208);
        margin-right: 8/@ppr;
      }

      .title {
        color: rgb(140, 140, 148);
        font-size: 26/@ppr;
      }
    }
    .list {
      // padding: 0 30/@ppr;
      flex: 1;
      .scrollable();
      padding-top: 30/@ppr;
      .select-row {
        padding: 0 30/@ppr;
        display: flex;
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        .coupon-cell {
          flex: 1;
        }
        .icon-checked, .icon-unchecked {
          font-size: 46/@ppr;
          margin-left: 30/@ppr;
        }
        .icon-checked {
          color: rgb(255, 102, 85);
        }
        .icon-unchecked {
          color: rgb(210, 211, 216);
        }
      }
    }
    .action-btn {
      border-radius: 0;
    }
  }
}

.coupon-gift-modal {
  z-index: 99;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  &.active {
    justify-content: flex-start;
    padding-top: 10/@ppr;
  }
  .content {
    background-image: url(../../images/coupon/modal.png);
    background-position: left top;
    background-size: 100%;
    background-repeat: no-repeat;
    width: 665/@ppr;
    height: 775/@ppr;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    .icon-close {
      color: white;
      font-size: 54/@ppr;
      position: absolute;
      top: 0;
      right: 0;
      padding: 40/@ppr;
    }
    .action-btn {
      width: 342/@ppr;
      height: 62/@ppr;
      border-radius: 31/@ppr;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      font-size: 22/@ppr;
      color: #f05438;
      .directional-gradient(#fefba9, #ffffff, 0deg);
      margin-bottom: 84/@ppr;
      margin-top: 34/@ppr;
    }
    .input {
      height: 70/@ppr;
      background: white;
      line-height: 70/@ppr;
      text-align: center;
      font-size: 30/@ppr;
      width: 342/@ppr;
      color: rgb(46, 46, 54);
      text-align: center;
    }
  }
}

.coupon-rule-modal {
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;

  .content {
    width: 520/@ppr;
    background: white;
    border-radius: 10/@ppr;
    padding-top: 40/@ppr;
    font-size: 26/@ppr;
    .title {
      color: rgb(140, 140, 148);
      margin: 0 44/@ppr 12/@ppr 44/@ppr;
    }
    .text {
      margin: 0 44/@ppr 26/@ppr 44/@ppr;
      padding: 0;
      font-size: 26/@ppr;
      color: rgb(46, 46, 54);
      line-height: 40/@ppr;
      word-break: break-all;
      &.rule {
        margin-bottom: 40/@ppr;
      }
    }

    .action-btn {
      height: 80/@ppr;
      line-height: 80/@ppr;
      text-align: center;
      color: rgb(255, 102, 85);
      font-size: 32/@ppr;
      border-top: 1px solid rgb(232, 234, 238);
    }
  }
}

.coupon-alert-modal {
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  .content {
    background: white;
    border-radius: 8/@ppr;
    margin: 0 98/@ppr;
    padding-top: 46/@ppr;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    .icon {
      width: 104/@ppr;
      height: auto;
      margin-bottom: 22/@ppr;
    }
    .text {
      padding: 0;
      font-size: 26/@ppr;
      line-height: 40/@ppr;
      color: rgb(46, 46, 54);
      margin: 0 40/@ppr;
    }
    .btn-view {
      align-self: stretch;
      margin-top: 42/@ppr;
      height: 84/@ppr;
      .hairline(top, rgb(232, 234, 238));
      display: flex;
      flex-direction: row;
      justify-content: flex-start;
      align-items: stretch;
      color: rgb(255, 116, 101);
      font-size: 32/@ppr;
      .action-btn {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        .hairline(right, rgb(232, 234, 238));
        &:last-child {
          .hairline-remove(right);
        }
        &.cancel {
          color: #b5b5b5;
        }
      }
    }
  }
}
